﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Configurations.Core;

namespace Pixysoft.Framework.Configurations
{
    public interface IConfigurationNode
    {
        /// <summary>
        /// 配置标签
        /// </summary>
        string NodeName { get;}


        /// <summary>
        /// 获取值
        /// </summary>
        string Text { get;set;}

        /// <summary>
        /// 获取base64的值
        /// </summary>
        string Base64Text { get;set;}

        /// <summary>
        /// 获取对称加密的值 (des(base64()))
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        string GetDesText(string key);

        /// <summary>
        /// 获取对称加密的值（base64(des())）
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        void SetDesText(string key, string value);

        /// <summary>
        /// 使用反射创建IoC对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T Create<T>();

        /// <summary>
        /// 获取子节点
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        IConfigurationNodeCollection Node { get;}

        /// <summary>
        /// 获取属性
        /// </summary>
        IConfigurationPropertyCollection Property { get;}



        /// <summary>
        /// 获取集合子节点（List等）
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        IConfigurationNodesCollection Nodes { get;}
    }
}
